#ifndef __KEY_H
#define __KEY_H

#include "stm32f1xx_hal.h"
#define KEY_PORT        GPIOB
#define KEY_PIN         GPIO_PIN_0
#define IO_READ()       HAL_GPIO_ReadPin(KEY_PORT,KEY_PIN)

typedef enum
{
  Key_Check = 0,
  Key_PressComfirm = 1,  
  Key_Released = 2 
}KeyState;

typedef enum
{
  NULL_Key = 0, 
  Short_Press,
  Long_Press
}Key_Flag;

extern uint8_t KeyState_Flag;
extern uint8_t KeyCurrentState;

uint8_t Key_Scan(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);

#endif
